import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

const path = require('path')

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src')
    }
  },
  base: './',
  server: {
    hostname: '0.0.0.0',
    open: true, // 如果需要在服务启动后自动打开页面可以打开这个设置
    port: 7000, // 端口
    https: false, // 启用https
    proxy: {
      '/api': {
        target: 'https://automaticdooropening.liuzhehao.com',
        changeOrigin: true
      }
    }
  }
})
